(function(angular){
	'use strict';
	angular.module('fs.waf').controller('cda.companyClass.viewController',viewController);
	viewController.$inject = ['$scope', 'Constants', 'layoutConfig', 'validatorConfig', 'gridService', 'authService', 'companyClassService'];
	function viewController ($scope, Constants, layoutConfig, validatorConfig, gridService, authService, companyClassService){
		var ctrl = this, companyClassInfo = $scope.$stateParams.params;
		
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;
		ctrl.init = function (){
			var params = {
					companyClass : companyClassInfo.companyClass
			};
			ctrl.innerGridOptions = gridService.createInnerGridOptions($scope, ctrl.layoutConfig.formConfigs.general);
			return authService.view(params).then(function(response){
				ctrl.companyClass = response.data || companyClassInfo;
			},angular.noop());
		};		
	}	
})(angular);